import { createApp, h, inject } from "vue";

import App from "./App.vue";

import {
  createWebHashHistory,
  createMemoryHistory,
  createRouter,
  createWebHistory,
} from "vue-router";

// import User from "./views/User.vue";
// import Home from "./views/Home.vue";
// import Login from "./views/Login.vue";
// import Shop from "./views/Shop.vue";

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/home",
      name: "home",
      component: () => import("./views/Home.vue"),
      meta: {
        menuName: "首页",
      },
    },
    {
      path: "/shop",
      name: "shop",
      component: () => import("./views/Shop.vue"),
      meta: {
        menuName: "商城",
      },
    },
    {
      path: "/user",
      name: "user",
      component: () => import("./views/User.vue"),
      meta: {
        menuName: "个人中心",
      },
    },
    {
      path: "/login",
      name: "login",
      component: () => import("./views/Login.vue"),
      meta: {
        menuName: "登录",
        hidden: true,
      },
    },
  ],
});

const app = createApp({ render: () => h(App) });

app.use(router);

app.mount("#app");
